package com.yanqu.road.entity.kowloon.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 方块类型
 */
public enum eKowloonBlockType {

    Element1(1, "基础元素1"),
    Element2(2, "基础元素2"),
    Element3(3, "基础元素3"),
    Element4(4, "基础元素4"),
    Element5(5, "基础元素5"),
    Element6(6, "基础元素6"),
    Element7(7, "基础元素7"),

    Silver(100, "银锭"),
    Skill(101, "技能福袋"),
    Hero1(1001, "好汉1"),
    Hero2(1002, "好汉2"),
    Hero3(1003, "好汉3"),
    Hero4(1004, "好汉4"),
    Hero5(1005, "好汉5"),
    Hero6(1006, "好汉6"),
    Hero7(1007, "好汉7"),
    ;

    private int value;
    private String name;

    eKowloonBlockType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static eKowloonBlockType forValue(int value) {
        for (eKowloonBlockType eKowloonBlockType : eKowloonBlockType.values()) {
            if (eKowloonBlockType.value == value) {
                return eKowloonBlockType;
            }
        }
        return eKowloonBlockType.Silver;
    }

    public static boolean isHero(int type) {
        return type == eKowloonBlockType.Hero1.getValue()
                || type == eKowloonBlockType.Hero2.getValue()
                || type == eKowloonBlockType.Hero3.getValue()
                || type == eKowloonBlockType.Hero4.getValue()
                || type == eKowloonBlockType.Hero5.getValue()
                || type == eKowloonBlockType.Hero6.getValue()
                || type == eKowloonBlockType.Hero7.getValue();
    }
}
